package com.yingxin.yxerp.module.dingtalk.entity;

/**
 * 字段类型
 */

public enum FieldTypeEnum {

    DDSelectField("DDSelectField", "选项类型"),
    TextField("TextField", "文本类型"),
    DDDateField("DDDateField", "日期类型"),
    DDDateWithLongField("DDDateWithLongField", "长日期类型"),
    DDPhotoField("DDPhotoField", "图片类型");

    private String type;

    private String typeName;

    FieldTypeEnum(String type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static FieldTypeEnum getEnum(String type) {
        if (type == null) {
            return null;
        }
        for (FieldTypeEnum i : FieldTypeEnum.values()) {
            if (i.getType().equals(type)) {
                return i;
            }
        }
        return null;
    }

}
